package alo.p6.work2;

import alo.p6.TreeNode;

/**
 * @ClassName FindSum
 * @Description 求N叉树的结点值之和
 * @Author Fanxc
 * @DATE 2021/2/2 11:00
 * @Version 1.0
 */
public class FindSum {
    int findSum(TreeNode root){
        if(root==null){
            return 0;
        }
        return root.getData()+findSum(root.getFirstChild())+findSum(root.getNextSibling());
    }
}
